/*
 * Copyright (C) Michael Martin & Antonio Carrozzini (TBJD)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

package org.tbjd.client.interfaces;

import com.google.gwt.user.client.ui.Widget;

/**
 * <p>A BorderNotifier is part of the border detection system.</p>
 * <p>The BorderNotifier allow {@link org.tbjd.client.interfaces.BorderListener BorderListener} to be notified when a border event is detected.
 * 
 * @author Michael Martin
 * @author Antonio Carrozzini
 * @version 1.0
 * 
 */
public interface BorderNotifier {

	/**
	 * This method adds a {@link org.tbjd.client.interfaces.BorderListener}
	 * 
	 * @param listener
	 *            the BorderListener to add
	 */
	public void addBorderListener(BorderListener listener);

	/**
	 * This method removes a {@link org.tbjd.client.interfaces.BorderListener}
	 * 
	 * @param listener
	 *            the BorderListener to remove
	 */
	public void removeBorderListener(BorderListener listener);

	/**
	 * <p>This method is called from a {@link org.tbjd.client.interfaces.BorderTrigger BorderTrigger}</p>
	 * <p>The caller passes the container of the widget which throw the event,
	 * the dragged item if there is and the x and y coordinate of the mouse position</p>
	 * 
	 * @param widgetsContainer
	 *            the panel on which the event occured
	 * @param draggable
	 *            the draggable widget throwing the event if there is one (otherwise null)
	 * @param x
	 *            the x coordinate of the mouse
	 * @param y
	 *            the y coordinate of the mouse
	 */
	public void mouseEvent(Widget widgetsContainer, Widget draggable, int x, int y);

}
